<template>
	<div class="grade">
		<view class="greenBg"></view>
		<view class="whiteBg" v-for="val in grade" :key="val.id">
			<view class="boxTitle">{{val.title}}</view>
			<view v-for="item in val.msg" :key="item.id" class="msg">
				<text class="floatLeft">{{item.title}}</text>
				<text class="floatRight">{{item.score}}</text>
			</view>
		</view>
		
	</div>
</template>

<script>
	const {getGrade} = require('../../utils/api.js')
	export default {
		data() {
			return {
				grade:[]
			}
		},
		created() {
			this.getList();
		},
		methods:{
			getList(){
				getGrade().then(data=>{
					this.grade = data.data;
					this.grade.forEach(item=>{
						item.msg = JSON.parse(item.msg);
					});
				})
			},
			forget(){
				uni.navigateTo({
					url: 'forget'
				});
			}
		}
	}
</script>

<style scoped src="../../static/css/grade.css"></style>
